home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / class / objary.d < prev    next >
Text File  |  1996-02-04  |  1KB  |  79 lines

  1.  
  2.  
  3.  
  4. /*                                      
  5.  *
  6.  *      Copyright (c) 1993-1996 Algorithms Corporation
  7.  *      3020 Liberty Hills Drive
  8.  *      Franklin, TN 37067
  9.  *
  10.  *      ALL RIGHTS RESERVED.
  11.  *
  12.  *      
  13.  *      
  14.  */
  15.  
  16.  
  17.  
  18. #include "array1.h"
  19.  
  20.  
  21. defclass  ObjectArray : Array  {
  22.  init:    init_class;
  23. };
  24.  
  25.  
  26.  
  27. #define TYPE    object
  28.  
  29.  
  30. static    gIndex_t    _index;
  31.  
  32.  
  33. cvmeth    vNew(unsigned rank, ...)
  34. {
  35.     static    gNewArray_t    cnew = NULL;
  36.     MAKE_REST(rank);
  37.  
  38.     if (!cnew)
  39.         cnew = cmcPointer(Array, gNewArray);
  40.     return cnew(self, AT_OBJ, rank, _rest_);
  41. }
  42.  
  43. ivmeth    vValue(...)
  44. {
  45.     MAKE_REST(self);
  46.     return *((TYPE *) _index(self, _rest_));
  47. }
  48.  
  49. ivmeth    vChangeValue(val, ...)
  50. {
  51.     MAKE_REST(val);
  52.     ChkArgNul(val, 2);
  53.     *((TYPE *) _index(self, _rest_)) = val;
  54.     return self;
  55. }
  56.  
  57. static    void    init_class(void)
  58. {
  59.     _index = imcPointer(Array, gIndex);
  60. }
  61.  
  62.  
  63.  
  64.  
  65. /*                                      
  66.  *
  67.  *      Copyright (c) 1993-1996 Algorithms Corporation
  68.  *      3020 Liberty Hills Drive
  69.  *      Franklin, TN 37067
  70.  *
  71.  *      ALL RIGHTS RESERVED.
  72.  *
  73.  *      
  74.  *      
  75.  */
  76.  
  77.  
  78.  
  79.